package com.luckcoder.relax.games.mapper;

import com.luckcoder.relax.games.domain.RelaxUserGameRecord;
import com.luckcoder.relax.games.domain.vo.RelaxUserGameRecordVo;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.Map;

/**
 * 用户游戏记录Mapper接口
 *
 * @author zhanghao
 * @date 2025-09-10
 */
public interface RelaxUserGameRecordMapper extends BaseMapperPlus<RelaxUserGameRecord, RelaxUserGameRecordVo> {

    /**
     * 统计指定游戏的总游玩次数
     *
     * @param gameCode 游戏编码
     * @return 游玩次数
     */
    Long countByGameCode(@Param("gameCode") String gameCode);

    /**
     * 统计所有游戏的游玩次数
     *
     * @return 游戏编码和对应的游玩次数映射
     */
    Map<String, Long> countAllGamePlayCount();
}
